<article style='text-align:center;overflow:auto;'>
	<h2>Page d'administration</h2>
	<table style='width:100%;'>
		<tr>
			<td style='width: 75%;vertical-align:top;'>
				<h3>Liste des utilisateurs</h3>
				<table style="width:100%;" class="aff_ad">
					<form method='POST' action="validate_user.php">
					<?php
					include '../conf/config.php';

					mysql_connect($host,$user_select,$mdp_select)or die("impossible de se connecter"); 

					mysql_select_db("website")or die("ne peut selectioner DB");
													
					$sql="SELECT * FROM user,statut WHERE user.FK_statut != 3 AND user.FK_statut=statut.id_statut ORDER BY Nom ASC;";
					$query=mysql_query($sql);

					while($row = mysql_fetch_array($query))
					{
						if ($row['valide'] == 0)
						{
							echo 
							"<tr class='non_valide' border-bottom:1px solid black;>
								<td><img src='/img/status_red.png' /></td>
								<td>#".$row['id_user'] . "</td>
								<td>".$row['nom_statut'] . "</td>
								<td>".utf8_decode($row['Nom']) . "</td>
								<td>" .utf8_decode($row['Prenom']) . "</td>
								<td><img src='/img/module_install.png' /> Valider : <input type='checkbox' name='valid[".$row['id_user']."]' value='1' checked></td>
								<td colspan = 2><a href='delete_user.php?id=".$row['id_user'] ."' onclick='confirm_delete()'><img src='img/module_notinstall.png' /> Supprimer</a></td>
							</tr>";
						}
						elseif ($row['id_statut']==1)
						{
							echo 
							"<tr class='prof'>
								<td><img src='/img/status_green.png' /></td>
								<td>#".$row['id_user'] . "</td>
								<td>".$row['nom_statut'] . "</td>
								<td>".utf8_decode($row['Nom']) . "</td>
								<td>" .utf8_decode($row['Prenom']) . "</td>
								<td><a href='edit_user.php?id=".$row['id_user'] ."'><img src='/img/tab-tools.gif' /> Editer</a></td>
								<td><a href='delete_user.php?id=".$row['id_user'] ."' onclick='confirm_delete()'><img src='img/module_notinstall.png' /> Supprimer</a></td>
							</tr>";
						}
						else
						{
							echo 
							"<tr style='height:0.7em;'>
								<td style='width:15px'><img src='/img/status_green.png' /></td>
								<td>#".$row['id_user'] . "</td>
								<td>".$row['nom_statut'] . "</td>
								<td>".utf8_decode($row['Nom']) . "</td>
								<td>" .utf8_decode($row['Prenom']) . "</td>
								<td><a href='edit_user.php?id=".$row['id_user'] ."'><img src='/img/tab-tools.gif' /> Editer</a></td>
								<td><a href='delete_user.php?id=".$row['id_user'] ."' onclick='confirm_delete()'><img src='img/module_notinstall.png' /> Supprimer</a></td>
							</tr>";
						}
					}
					?>
				</table>
				<input type='submit' name='valider' />
				</form>
			</td>

			<td style='vertical-align:top;'>
				<h3><a href="create_admin_user.php">Ajouter un utilisateur</a></h3>
			</td>
		</tr>
	</table>
	
</article>